package com.andy.module.util

import me.hgj.jetpackmvvm.network.AppException
import me.hgj.jetpackmvvm.network.BaseResponse
import me.hgj.jetpackmvvm.state.ResultState

/**
 * @creator:LuoFan
 * @date:2022/6/6
 * @description:
 */
class ViewModelUtil {

    companion object {

        fun <T> genAppError(result: BaseResponse<T>): ResultState<T> {
            return ResultState.onAppError(AppException(result.getResponseCode(), result.getResponseMsg()))
        }
    }
}